package com.youmu.xxessj.ac

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.youmu.xxessj.R
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.heard.*
import org.jetbrains.anko.intentFor
import org.jetbrains.anko.singleTop

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        init_heard()
        init()
    }
    fun init_heard(){
        heard_back.visibility = View.GONE
        heard_ok.visibility = View.GONE
        heard_title.text = "首页"
    }

    fun init(){
        main_jf.text = "当前积分："+ intent.getStringExtra("jf")
        main_fbsj.setOnClickListener {
            startActivity(intentFor<fbsjActivity>("id" to intent.getStringExtra("id"),"jf" to intent.getStringExtra("jf")).singleTop())
        }
        main_sj.setOnClickListener {
            startActivity(intentFor<sjlistActivity>("id" to intent.getStringExtra("id"),"jf" to intent.getStringExtra("jf"),"type" to "1").singleTop())
        }
        main_mysj.setOnClickListener {
            startActivity(intentFor<sjlistActivity>("id" to intent.getStringExtra("id"),"jf" to intent.getStringExtra("jf"),"type" to "2").singleTop())
        }
    }
}
